package com.cwx.mychat.entity.enums;

/**
 * 作者： cwx
 * 时间： 2024/10/13 9:43
 * 版本： 1.0
 * 注释：
 */
public enum PersonalityStatusEnum {

    ONLINE(1, "在线"),
    LEAVE(2, "离开"),
    NOT_DISTURB(3, "勿扰"),
    BUSY(4, "繁忙"),
    INVISIBLE(5, "隐身"),
    STUDY(6, "学习");


    private Integer status;
    private String msg;

    PersonalityStatusEnum(Integer status, String msg){
        this.status = status;
        this.msg = msg;
    }

    public Integer getStatus() {
        return status;
    }

    public String getMsg() {
        return msg;
    }

    public PersonalityStatusEnum getByStatus(Integer status){
        for(PersonalityStatusEnum item: PersonalityStatusEnum.values()){
            if(item.getStatus().equals(status)){
                return item;
            }
        }
        return null;
    }
}
